LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

#LOCAL_ARM_MODE := arm

LOCAL_SRC_FILES :=
LOCAL_SRC_FILES += jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
LOCAL_SRC_FILES += jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
#LOCAL_SRC_FILES += jcphuff.c 
LOCAL_SRC_FILES += jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c
LOCAL_SRC_FILES += jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c
LOCAL_SRC_FILES += jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c
#LOCAL_SRC_FILES += jdphuff.c
LOCAL_SRC_FILES += jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c
LOCAL_SRC_FILES += jfdctint.c jidctflt.c jquant1.c
LOCAL_SRC_FILES += jquant2.c jutils.c jmemmgr.c
LOCAL_SRC_FILES += jmem-android.c

LOCAL_SRC_FILES += jcarith.c jaricom.c jdarith.c

# the assembler is only for the ARM version, don't break the Linux sim
ifneq ($(TARGET_ARCH),arm)
ANDROID_JPEG_NO_ASSEMBLER := true
endif

#FIXME: by weimingtom
# temp fix until we understand why this broke cnn.com
ANDROID_JPEG_NO_ASSEMBLER := true

ifeq ($(strip $(ANDROID_JPEG_NO_ASSEMBLER)),true)
LOCAL_SRC_FILES += jidctint.c jidctfst.c
else
LOCAL_SRC_FILES += jidctint.c jidctfst.S
endif

LOCAL_CFLAGS += -DAVOID_TABLES 
#LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays



#LOCAL_CFLAGS += -march=armv6j

LOCAL_MODULE:= jpeg
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)

include $(BUILD_STATIC_LIBRARY)
